package com.four.vo;

import lombok.Data;

/**
 * @author: WangPeng
 * @createTime: 2022/10/12 16:30
 * @description:
 * @version: v1.0
 */
@Data
public class Result {
    //状态码
    private int code;
    //消息
    private String msg;
    //数据
    private Object data;

    public Result() {
    }

    public Result(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Result(int code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public static Result success() {
        return new Result(1, "操作成功", (Object)null);
    }

    @Override
    public String toString() {
        return "Result{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                ", data=" + data +
                '}';
    }
}
